<template>
	<view class="container">
		<view class="box">
			<!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
			<u--form labelPosition="left" :model="option" labelWidth='110px' :labelStyle='labelStyle'>
				<u-form-item label="巡检项目" borderBottom>
					<u--input v-model="option.ms" disabled disabledColor='#fff' border="none"></u--input>
				</u-form-item>
				<u-form-item label="巡检人" borderBottom>
					<u--input v-model="option.checkPerson" disabled disabledColor='#fff' border="none"></u--input>
				</u-form-item>
				<u-form-item label="巡检结果" borderBottom>
					<u--input v-model="option.checkStatu" disabled disabledColor='#fff' border="none"></u--input>
				</u-form-item>
				<u-form-item label="巡检周期单位" borderBottom>
					<u--input v-model="option.cycle" disabled disabledColor='#fff' border="none"></u--input>
				</u-form-item>
				<u-form-item label="隐患排查类型" borderBottom>
					<u--input v-model="option.checkTypes" disabled disabledColor='#fff' border="none"></u--input>
				</u-form-item>
<!--				<u-form-item label="隐患排查内容">-->
<!--					<textarea v-model="option.troubleshootContents" cols="30" rows="10"></textarea>-->
<!--				</u-form-item>-->
        <view style="color: #838383;padding: 10px 0">隐患排查内容</view>
        <!--				<u-form-item label="隐患排查内容">-->
        <textarea v-model="option.yhpcnr" height="120" disabled disabledColor='#fff'
                  style="background:#f6f6f6;margin-bottom: 30px;width: 100%!important;"></textarea>
			</u--form>
		</view>
		<!-- <view class="butt">
			<u-button type="primary" text="开始巡检" @click="submit" class='but'></u-button>
		</view> -->
	</view>
</template>

<script>
	export default {
	  onLoad(option){
	    this.option =JSON.parse(option.option)
		this.option.cycle  =parseInt(JSON.parse(option.option).xjzq)+"/" + JSON.parse(option.option).checkCycleUnit
      console.log("this.option=========>",this.option);
	    if (this.option.checkStatus === "0"){
	      this.option.checkStatu = '正常'
      }else if(this.option.checkStatus === "1"){
	      this.option.checkStatu = '存在隐患'
      }else if(this.option.checkStatus === '2'){
	      this.option.checkStatu='未排查'
      }else if(this.option.checkStatus === '3'){
	      this.option.checkStatus = '其他'
      }
    },
    onShow(){
      if (this.option.troubleshootContent === "1") {
        this.option.troubleshootContents = '自动化监控'
      } else if (this.option.troubleshootContent === '2') {
        this.option.troubleshootContents = '隐患排查'
      }

      if (this.option.checkType === 1) {
        this.option.checkTypes = '综合性检查'
      } else if (this.option.checkType === 2) {
        this.option.checkTypes = '专业性检查'
      } else if (this.option.checkType === 3) {
        this.option.checkTypes = '季节性检查'
      } else if (this.option.checkType === 4) {
        this.option.checkTypes = '日常性检查'
      } else if (this.option.checkType === 5) {
        this.option.checkTypes = '节假日检查'
      } else if (this.option.checkType === 6) {
        this.option.checkTypes = '节假日检查'
      }
    },
		data() {
			return {
        option:{
          checkStatus:'',
          checkTypes:'',
          troubleshootContents:''
        },
				labelStyle: {
					color: '#666'
				},
			}
		},
		methods: {
			submit() {
				uni.showToast({
					icon:"none",
					duration:2000,
					title:'请扫描隐患点二维码'
				})
				setTimeout(()=>{
					uni.navigateTo({
						url: '../hiddenDanger/hiddenDanger'
					})
				},2000)
			}
		}
	}
</script>

<style lang="scss">
	.container {
    height: calc(100vh - 88px);
		padding: 40rpx 24rpx;
		background-color: #f6f6f6;
	}

	.box {
		background-color: #fff;
		padding: 10rpx 30rpx;
		border-radius: 20rpx;
	}

	.butt {
		margin-top: 30rpx;
	}
</style>
